padding number in php

46

padding number in php -

$number = 12;
$width = 4;
$padded = str_pad((string)$number, $width, "0", STR_PAD_LEFT); 

Comments

Submit
0 Comments